<?php
/**
 * @description 用户列表
 * @author 陈武<chenwu@myhexin.com>
 * @history
 *         2020/4/21 23:29 create
 */
namespace Home\Model;
class UserModel
{
    /**
     * @description 搜索
     * @param int $page
     * @param int $size
     * @param array $where
     * @return mixed
     */
    public function search($page = 1, $size = 10, $where = [])
    {
        return M('user')->page($page)->limit($size)->where($where)->select();
    }

    /**
     * @description 总条数
     * @param array $where
     * @return int
     */
    public function total($where)
    {
        $result = M('user')->field('id')->where($where)->select();
        return $result?count($result):0;
    }
}